<!-- 会员中心主内容区 -->
<div class="page-article">
  <!-- 欢迎中心 -->
  <{if $gys}>
  <div class="member_welhead"><ins></ins><b><{if $gys==1}><{t}>供应商<{/t}><{elseif $gys==2}><{t}>集货员<{/t}><{/if}><{t}>中心<{/t}></b> </div>
  <div id="member_welcome" class="member-welcome">
	  <div class="member-welcome-content">
		  <div class="member-welcome-tips"><{t}>您好<{/t}> <em><{$member.uname}></em>，<{t}>欢迎进入<{if $gys==1}>供应商<{elseif $gys==2}>集货员<{/if}>管理中心<{/t}></div>
	</div>
  <{else}>
  <div class="member_welhead"><ins></ins><b><{t}>会员中心<{/t}></b> </div>
  <div id="member_welcome" class="member-welcome">
    <div class="member-welcome-content">
      <div class="person-edit">
           <i class="iconfont">&#xe63c;</i>
           <p><a href="<{link app=b2c ctl=site_member act=setting}>"><{t}>编辑个人资料<{/t}></a></p>
      </div>
      <div class="member-welcome-tips"><{t}>您好<{/t}> <em><{$member.uname}></em>，<{$member.levelname}></div>
      <ul class="member-welcome-desc">
        <{if $point_usaged == 'true'}>
        <li><{t}>账户总积分<{/t}>: <strong><{$member.usage_point}></strong> <a href="<{link app=pointprofessional ctl='site_point'  full='1' act='point_detail'}>"><{t}>查看积分记录<{/t}> &raquo;</a></li>
        <{/if}>
		    <{if $deposit_status == 'true'}>
        <li>
		<i class="iconfont">&#xe640;</i> <{t}>预存款余额<{/t}>: <b><{$member.advance|cur_odr}></b> 
		<!--<a href="<{link app=b2c ctl='site_member'  full='1' act='deposit'}>"><{t}>充值<{/t}> &raquo;</a>-->
		</li>
        <{/if}>
      </ul>
    </div>
    <div class="member-welcome-alert">
      <{t}>交易提醒<{/t}>: 
      <a class="item" href="<{link app=b2c ctl=site_member act=orders arg0=nopayed}>"><{t}>未付款订单<{/t}><span class="label-<{if $member.un_pay_orders == '0'}>disabled<{else}>alert<{/if}>"><{$member.un_pay_orders}></span></a>
      <!--预售订单-->
      <a class="item" href="<{link app=b2c ctl=site_member act=orders arg0=prepare}>"><{t}>预售订单<{/t}><span class="label-<{if $member.prepare_pay_orders == '0'}>disabled<{else}>alert<{/if}>"><{$member.prepare_pay_orders}></span></a>
      <a class="item" href="<{link app=b2c ctl=site_member act=notify}>"><{t}>到货通知<{/t}><span class="label-<{if $member.sto_goods_num == '0'}>disabled<{else}>alert<{/if}>"><{$member.sto_goods_num}></span></a>
      <{if $comment_switch_discuss == 'on'}>
      <a class="item" href="<{link app=b2c ctl=site_member act=comment}>"><{t}>评论回复<{/t}><span class="label-<{if $member.un_readDiscussMsg == '0'}>disabled<{else}>alert<{/if}>"><{$member.un_readDiscussMsg}></span></a>
      <{/if}>
      <{if $comment_switch_ask == 'on'}>
      <a class="item" href="<{link app=b2c ctl=site_member act=ask}>"><{t}>咨询回复<{/t}><span class="label-<{if $member.un_readAskMsg == '0'}>disabled<{else}>alert<{/if}>"><{$member.un_readAskMsg}></span></a>
      <{/if}>
    </div>
  </div>

  <!-- 最近的订单 -->
  <div id="member_orders" class="member-mod">
    <div class="member-mod-title">
      <h2><{t}>最近的订单<{/t}></h2>
      <{if $orders}>
      <span class="member-mod-more"><a href="<{link app=b2c ctl=site_member act=orders}>"><{t}>所有订单<{/t}> &raquo;</a></span>
      <{/if}>
    </div>
    <div class="member-mod-content">
      <{include file='site/member/order_item.html'}>
    </div>
  </div>

  <!-- 最新收藏 -->
  <div id="member_fav" class="member-mod member_fav">
    <div class="member-mod-title">
      <h2><{t}>我收藏的商品<{/t}></h2>
      <{if $favorite}>
      <span class="member-mod-more"><a href="<{link app=b2c ctl=site_member act=favorite}>"><{t}>所有收藏<{/t}> &raquo;</a></span>
      <{/if}>
    </div>
    <div class="memeber-mod-content">
      <{if $favorite}>
      <ul class="member-goods-list">
        <{foreach from=$favorite item="favorite" name=favorite}>
        <li class="goods-item">
          <div class="goods-pic"><{if !$favorite.goods_name}><a href="<{link app=b2c ctl=site_product arg0=$favorite.spec_desc_info.0.product_id}>"><{/if}><img src="<{if $favorite.udfimg == 'true'}><{$favorite.thumbnail_pic|default:$defaultImage|storager:'s'}><{else}><{$favorite.image_default_id|default:$defaultImage|storager:'s'}><{/if}>" alt="<{$favorite.name|default:$favorite.goods_name}>"></a></div>
          <h3 class="goods-name"><{if !$favorite.goods_name}><a href="<{link app=b2c ctl=site_product arg0=$favorite.spec_desc_info.0.product_id}>"><{/if}><{$favorite.name|default:$favorite.goods_name}></a></h3>
          <!--<div class="price"><{$favorite.price|default:$favorite.goods_price|cur_odr}></div>-->
        </li>
        <{if $smarty.foreach.favorite.iteration == 5}>
        <li class="last"></li>
        <{break}>
        <{/if}>
        <{/foreach}>
      </ul>
      <{else}>
      <div class="no-information"><{t}>暂无收藏<{/t}></div>
      <{/if}>
    </div>
  </div>
</div>


<{if $orders}>
<script>
// Module = new Module('member', ['orders']);
$('member_orders').addEvents({
    'click:relay(.action-view-goods)':function (e) {
        var parent = this.getParent('tbody');
        var actions = parent.getElement('.actions');
        if(parent.hasClass('fold')) {
            actions.set('rowspan', 2);
            parent.removeClass('fold').addClass('unfold');
        }
        else {
            actions.set('rowspan', 1);
            parent.removeClass('unfold').addClass('fold');
        }
    }
});

window.addEvent('domready', function(){
    var tipsHandle = $$('[data-tips]');
    if(tipsHandle.length) {
        var tips = new Tips({
            type: 'tooltip',
            'class': 'xtooltip',
            arrow: false,
            offset:{y:-1},
            position: 'bl'
        });
        tipsHandle.addEvents({
            'mouseenter': function(){
                tips.show(null, this);
            },
            'mouseleave': function(){
                tips.hide();
            }
        });
    }
});
</script>
<{/if}>
<{/if}>